<?

require_once("GDGraph/gdgraph.php");
	include('includes/conexion.php');

	$sql = "call sp_s_tablero(null, null, null,null, null, null, null, null )";

	$resultado = dbh_query($sql) or die(mysqli_error($dbh));
	
	
		
	$array3 = array();
	
	$i=1;
	
	$color1=10;
	$color2=20;
	$color3=20;
	
	
	$height= 500;
	$width = 150 * mysqli_num_rows($resultado);
	
	//echo mysqli_num_fields($resultado);
	
	while ($item = dbh_fetch($resultado)) {
	
	    	
		$color1 = $color1> 1000?$color1= 10:$color1 + $color1;
		
		$color2 = $color2> 1000?$color2= 20:$color2 + $color2;
		
		$color3 = $color3> 1000?$color3= 30:$color3 + $color3;
		
		$array3[$item['tx_motivo']] = array($item['cant'] ,$color1 , $color2, $color3, 0 );
		
	}
	
	 
	$gdg2 = new GDGraph($width,$height,"Reclamos");
	$arr2 = Array(
		'First Trimester' => Array(1000,200,100,1000,0),
		'Second Trimester' => Array(1200,200,200,10,0),
		'Third Trimester' => Array(-500,23,255,100,0)
	);
	$gdg2->bar_graph($array3);	//Line A */
?>
